import 'package:flutter_test/flutter_test.dart';
import 'package:business_dialog/business_dialog.dart';
import 'package:business_dialog/business_dialog_platform_interface.dart';
import 'package:business_dialog/business_dialog_method_channel.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockBusinessDialogPlatform
    with MockPlatformInterfaceMixin
    implements BusinessDialogPlatform {

  @override
  Future<String?> getPlatformVersion() => Future.value('42');
}

void main() {
  final BusinessDialogPlatform initialPlatform = BusinessDialogPlatform.instance;

  test('$MethodChannelBusinessDialog is the default instance', () {
    expect(initialPlatform, isInstanceOf<MethodChannelBusinessDialog>());
  });

  test('getPlatformVersion', () async {
    BusinessDialog businessDialogPlugin = BusinessDialog();
    MockBusinessDialogPlatform fakePlatform = MockBusinessDialogPlatform();
    BusinessDialogPlatform.instance = fakePlatform;

    expect(await businessDialogPlugin.getPlatformVersion(), '42');
  });
}
